package com.jianwei.web.action;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import com.jianwei.web.pojo.Users;
import com.jianwei.web.service.LoginService;
import com.jianwei.web.util.StrutsUtils;
import com.opensymphony.xwork2.ActionSupport;

@Controller("loginAction")
public class LoginAction extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -2347336978026370828L;
	private Users user;
	@Autowired
	private LoginService loginService;
	
	/**
	 * 用户登录
	 */
	public void loginUser(){
		StrutsUtils.readJson(loginService.loginUser(user).toString());
	}
	
	/**
	 * 检测用户是否已登录
	 */
	public void checkSession(){
		StrutsUtils.readJson(loginService.checkSession().toString());
	}
	
	public Users getUser() {
		return user;
	}

	public void setUser(Users user) {
		this.user = user;
	}
	
	
}
